package com.ltl.keep_book.result;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * Copyright © 2023 MetaEnergy. All rights reserved.
 *
 * @ClassName: ResultCode
 * @Description: 通用返回Code
 * @author: lwl
 * @date: 2024/5/22
*/
@AllArgsConstructor
@NoArgsConstructor
public enum ResultCode implements IResultCode, Serializable {

    SUCCESS("200", "success"),
    SYSTEM_EXECUTION_ERROR("999999", "系统执行出错"),
    USERNAME_OR_PASSWORD_ERROR("A00100", "验证码错误"),
    USER_NOT_EXIST("A00101", "用户不存在"),
    CLIENT_AUTHENTICATION_FAILED("A00212", "客户端认证失败"),
    ACCESS_UNAUTHORIZED("A00213", "未授权"),
    TOKEN_INVALID_OR_EXPIRED("A00214", "token非法或失效"),
    TOKEN_ACCESS_FORBIDDEN("A00215", "登录状态过期，请重新登录！"),
    USER_NAME("A00301", "名称长度超过20位字符！"),
    FLOW_LIMITING("B0210", "系统限流"),
    DEGRADATION("B0220", "系统功能降级"),
    SERVICE_NO_AUTHORITY("B0221", "服务未授权"),
    RESOURCE_NOT_FOUND("C00100", "资源未找到"),
    INVALID_REQUEST_PARAMETERS("C00200", "无效的请求参数"),
    DATA_VALIDATION_FAILED("C00201", "数据验证失败"),
    ERROR_REQUEST_URL("C00202", "无效的url"),
    DATA_ERROR("C00300", "数据错误"),
    FILE_UPLOAD_FAILED("C00400", "文件上传失败"),
    EXTERNAL_API_ERROR("C00600", "外部API调用错误"),
    TIMEOUT_ERROR("C00700", "超时错误"),
    PLAY_METHOD_REWARD_ERROR("P00100", "玩法不存在或已下架"),

    PLAY_METHOD_LUCKY_PRIZE_DRAW_ERROR("P00299", "当前不支持购买"),
    PLAY_METHOD_LUCKY_REVELRY_ERROR("P00310","本场狂欢已结束，敬请期待下一场的开启"),
    PLAY_METHOD_REWARD_MARGIN_ERROR("P99999", "该箱子已被抢光，支付金额将原路退款，请注意查收"),

    PAY_IDLE_MARGIN_ERROR("P99999", "该箱子已被抢光，支付金额将原路退款，请注意查收"),

    UNKNOWN_ERROR("Z99999", "未知异常！");


    private String code;

    private String msg;

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return "{ code:" + code + ", msg:" + msg + "}";
    }
}